<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="${pageContext.request.contextPath}/jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<link href="${pageContext.request.contextPath}/jquery/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery-1.11.1-min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath} /jquery/bootstrap-datetimepicker-master/locale/bootstrap-datetimepicker.zh-CN.js"></script>
<style>
	#sp{
		color: red;
		font-size: 13px;
		padding-left: 30%;
	}
	#sp1{
		color: red;
		font-size: 13px;
		padding-left: 30%;
	}
</style>
<script type="text/javascript">

	$(function(){
		//给"创建"按钮添加单击事件
		$("#createActivityBtn").click(function () {
			//初始化工作
			//重置表单
			$("#createActivityForm").get(0).reset();

		});
		//给"保存"按钮添加单击事件
		$("#saveCreateActivityBtn").click(function () {
			//收集参数
			var owner=$("#create-marketActivityOwner").val();
			var name=$.trim($("#create-marketActivityName").val());
			var startDate=$("#create-startDate").val();
			var endDate=$("#create-endDate").val();
			var cost=$.trim($("#create-cost").val());
			var description=$.trim($("#create-describe").val());
			//表单验证
			if(owner==""){

				$("#sp").html("所有者不能为空")
				return;
			}
			if(name==""){
				$("#sp").html("名称不能为空")
				return;
			}
			if(startDate!=""&&endDate!=""){
				//使用字符串的大小代替日期的大小
				if(endDate<startDate){
					$("#sp").html("结束日期不能比开始日期小")
					return;
				}
			}
			var regExp=/^(([1-9]\d*)|0)$/;
			if(!regExp.test(cost)){
				$("#sp").html("成本只能为非负整数")
				return;
			}
			//发送请求
			$.ajax({
				url:'${pageContext.request.contextPath}/workbench/saveActivity',
				data:{
					owner:owner,
					name:name,
					startDate:startDate,
					endDate:endDate,
					cost:cost,
					description:description
				},
				type:'post',
				dataType:'json',
				success:function (data) {
					if(data.code=="1"){
						//关闭模态窗口
						$("#createActivityModal").modal("hide");
						alert(data.msg);
						//刷新市场活动列，显示第一页数据，保持每页显示条数不变
						window.location.href="${pageContext.request.contextPath}/workbench/findAll";
					}else{
						//提示信息
						alert(data.msg);
						//模态窗口不关闭
						$("#createActivityModal").modal("show");//可以不写。
					}
				}
			});
		});
		function find() {
			var owner = $("#owner").val();
			var name = $("#name").val();;
			//查询发送请求
			$.ajax({
				url:'${pageContext.request.contextPath}/workbench/findAll',
				data:{
					owner:owner,
					name:name,
				},
				type:'post',
				dataType:'json',
				success:function (data) {
					//刷新市场活动列，显示第一页数据，保持每页显示条数不变
					window.location.href="${pageContext.request.contextPath}/workbench/findAll";
				}
			});
		}
		find();
		$("#query").click(function () {
			var owner = $("#owner").val();
			var name = $("#name").val();
			//查询发送请求
			$.ajax({
				url:'${pageContext.request.contextPath}/workbench/findByName',
				data:{
					owner:owner,
					name:name,
				},
				type:'post',
				dataType:'json',
				success:function (data) {
					//遍历activityList，拼接所有行数据
					var htmlStr="";
					$.each(data.activityList,function (index,obj) {
						htmlStr+="<tr class=\"active\">";
						htmlStr+="<td><input type=\"checkbox\" value=\""+obj.id+"\"/></td>";
						htmlStr+="<td><a style=\"text-decoration: none; cursor: pointer;\" onclick=\"window.location.href='workbench/activity/detailActivity.do?id="+obj.id+"'\">"+obj.name+"</a></td>";
						htmlStr+="<td>"+obj.owner+"</td>";
						htmlStr+="<td>"+obj.startDate+"</td>";
						htmlStr+="<td>"+obj.endDate+"</td>";
						htmlStr+="</tr>";
					});
					$("#tBody").html(htmlStr);
					//刷新市场活动列，显示第一页数据，保持每页显示条数不变
					//window.location.href="${pageContext.request.contextPath}/global/activity";
				}
			});
		})

		//全选按钮添加全选事件
		$("#chckAll").click(function () {
			//如果是全选 按钮的选中状态 则所有的checkbox都选中
			if(this.checked){
				$("#tBody input[type='checkbox']").prop("checked",true);
			} else {
				$("#tBody input[type='checkbox']").prop("checked",false);
			}
		});
		//如果有一个没有选中 全选按钮取消
		$("#tBody").on("click","input[type='checkbox']",function () {
			if($("#tBody input[type='checkbox']").size()==$("#tBody input[type='checkbox']:checked").size()){
				$("#chckAll").prop("checked",true);
			}else{
				$("#chckAll").prop("checked",false);
			}
		});
		//给删除添加  单击事件
		$("#deleteIdALL").click(function () {
			//收集参数
			//获取列表中所有被选中的checkbox
			var checkedIds = $("#tBody input[type='checkbox']:checked");

			if(checkedIds.size()==0){
				alert("还没有选择要删除的选项哦！")
				return ;
			}
			if(confirm("你确定要删除所选择的这些数据吗？")){
				var ids ="";
				//进行id获取
				$.each(checkedIds,function () {//id=xxxx&id=xxx&.....&id=xxx&
					ids+="id="+this.value+"&";
				});
				ids=ids.substr(0,ids.length-1);
				$.ajax({
					url:'${pageContext.request.contextPath}/workbench/deleteByIdAll',
					data:ids,
					type:'post',
					dataType:'json',
					success:function (data) {
						if(data.code=="1"){
							alert(data.msg);
							//刷新市场活动列，显示第一页数据，保持每页显示条数不变
							window.location.href="${pageContext.request.contextPath}/workbench/findAll";

						}else{
							//提示信息
							alert(data.msg);
						}
					}
				})
			}
		});
		//给"保存"按钮添加单击事件
		$("#update").click(function () {
			//收集参数
			var id =$("#edit-id").val();
			var owner=$("#edit-marketActivityOwner").val();
			var name=$.trim($("#edit-marketActivityName").val());
			var startDate=$("#edit-startDate").val();
			var endDate=$("#edit-endDate").val();
			var cost=$.trim($("#edit-cost").val());
			var description=$.trim($("#edit-describe").val());
			//表单验证
			if(owner==""){

				$("#sp1").html("所有者不能为空")
				return;
			}
			if(name==""){
				$("#sp1").html("名称不能为空")
				return;
			}
			if(startDate!=""&&endDate!=""){
				//使用字符串的大小代替日期的大小
				if(endDate<startDate){
					$("#sp1").html("结束日期不能比开始日期小")
					return;
				}
			}
			var regExp=/^(([1-9]\d*)|0)$/;
			if(!regExp.test(cost)){
				$("#sp1").html("成本只能为非负整数")
				return;
			}
			//发送请求
			$.ajax({
				url:'${pageContext.request.contextPath}/workbench/update',
				data:{
					id:id,
					owner:owner,
					name:name,
					startDate:startDate,
					endDate:endDate,
					cost:cost,
					description:description
				},
				type:'post',
				dataType:'json',
				success:function (data) {
					if(data.code=="1"){
						//关闭模态窗口
						$("#editActivityModal").modal("hide");
						alert(data.msg);
						//刷新市场活动列，显示第一页数据，保持每页显示条数不变
						window.location.href="${pageContext.request.contextPath}/workbench/findAll";
					}else{
						//提示信息
						alert(data.msg);
						$("#editActivityModal").modal("hide");
					}
				}
			});
		});
		//批量导出操作
		$("#exportActivityAllBtn").click(function () {
			window.location.href="${pageContext.request.contextPath}/workbench/exportAllActivity"
		});
		//批量选择导出操作
		$("#exportActivityXzBtn").click(function () {
			//收集参数
			//获取列表中所有被选中的checkbox
			var checkedIds = $("#tBody input[type='checkbox']:checked");

			if(checkedIds.size()==0){
				alert("还没有选择要导出的选项哦！")
				return ;
			}
			var ids ="";
			//进行id获取
			$.each(checkedIds,function () {//id=xxxx&id=xxx&.....&id=xxx&
				ids+="id="+this.value+"&";
			});
			ids=ids.substr(0,ids.length-1);
			window.location.href="${pageContext.request.contextPath}/workbench/findById?id="+ids
		});
		//批量文件导入
		$("#importActivityBtn").click(function () {
			//收集参数  获取文件后缀名
			var fileName = $("#activityFile").val();
			var suffix = fileName.substr(fileName.lastIndexOf(".")+1).toLocaleLowerCase();
			if(fileName==null){
				alert("还没有选择文件哦")
				return;
			}
			if(suffix!="xls"){
				alert("只支持xls文件哦")
				return;
			}
			//获取到文件
			var multipartFile = $("#activityFile")[0].files[0];
			//文件大小不能超过5MB  这里单位是字节
			if(multipartFile.size>5*1024*1024){
				alert("文件大小不能超过5MB哦")
				return;
			}
			//发送请求
			//FormData是ajax提供的接口 可以模拟键值对向后台提交参数
			//FormData还能提交二进制数据
			var formData = new FormData();
			//这里的参数要与后台接收的参数保持一致
			formData.append("multipartFile",multipartFile);
			$.ajax({
				url:"${pageContext.request.contextPath}/workbench/importActivityAll",
				data:formData,
				//因为上传文件要满足三个条件 编码 标签 提交 所以这里要进行配置一下
				processData:false,//设置ajax向后台提交参数之前 是否把参数统一转成字符串  默认是true
				contentType:false,//设置ajax向后台提交参数之前 是否把所有参数统一按urlencoded编码 默认是true
				type:"post",
				dataType:"json",
				success:function (data) {
					if(data.code=="1"){
						//关闭模态窗口
						$("#importActivityModal").modal("hide");
						alert(data.msg);
						//刷新市场活动列，显示第一页数据，保持每页显示条数不变
						window.location.href="${pageContext.request.contextPath}/workbench/findAll";
					}else{
						alert(data.msg);
						//模态窗口不关闭
						$("#importActivityModal").modal("show");
					}
				}
			});

		});
	});
	function deletes(id) {
		$("#exitModal").modal("show");
		$("#del").click(function () {
			$.ajax({
				url:'${pageContext.request.contextPath}/workbench/deleteById',
				data:{
					id:id,
				},
				type:'post',
				dataType:'json',
				success:function (data) {
					if(data.code=="1"){
						alert(data.msg);
						//刷新市场活动列，显示第一页数据，保持每页显示条数不变
						window.location.href="${pageContext.request.contextPath}/workbench/findAll";

					}else{
						//提示信息
						alert(data.msg);
					}

				}
			})
		})
	}
	function edits(id) {
		//发送请求
		$.ajax({
			url:'${pageContext.request.contextPath}/workbench/updateByIds',
			data:{
				id:id
			},
			type:'post',
			dataType:'json',
			success:function (data) {
				//把市场活动的信息显示在修改的模态窗口上
				$("#edit-id").val(data.id);
				$("#edit-marketActivityOwner").val(data.owner);
				$("#edit-marketActivityName").val(data.name);
				$("#edit-startTime").val(data.startDate);
				$("#edit-endTime").val(data.endDate);
				$("#edit-cost").val(data.cost);
				$("#edit-description").val(data.description);
				//弹出模态窗口
				$("#editActivityModal").modal("show");
			}
		});
	}
	function toDetail(id) {
		window.location.href="${pageContext.request.contextPath}/workbench/detailShow?id="+id
	}

	
</script>
</head>
<body>

	<!-- 创建市场活动的模态窗口 -->
	<div class="modal fade" id="createActivityModal" role="dialog">
		<div class="modal-dialog" role="document" style="width: 85%;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title" id="myModalLabel1">创建市场活动</h4>
					<span id="sp"></span>
				</div>
				<div class="modal-body">
				
					<form id="createActivityForm"  class="form-horizontal" role="form">
					
						<div class="form-group">
							<label for="create-marketActivityOwner" class="col-sm-2 control-label">所有者<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="create-marketActivityOwner">
								  <c:forEach items="${applicationScope.userList}" var="user">
										<option value="${user.name}">${user.name}</option>
								  </c:forEach>
								</select>
							</div>
                            <label for="create-marketActivityName" class="col-sm-2 control-label">名称<span style="font-size: 15px; color: red;">*</span></label>
                            <div class="col-sm-10" style="width: 300px;">
                                <input type="text" class="form-control" id="create-marketActivityName">
                            </div>
						</div>
						
						<div class="form-group">
							<label for="create-startDate" class="col-sm-2 control-label">开始日期</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="date" class="form-control" id="create-startDate">
							</div>
							<label for="create-endDate" class="col-sm-2 control-label">结束日期</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="date" class="form-control" id="create-endDate">
							</div>
						</div>
                        <div class="form-group">

                            <label for="create-cost" class="col-sm-2 control-label">成本</label>
                            <div class="col-sm-10" style="width: 300px;">
                                <input type="text" class="form-control" id="create-cost">
                            </div>
                        </div>
						<div class="form-group">
							<label for="create-describe" class="col-sm-2 control-label">描述</label>
							<div class="col-sm-10" style="width: 81%;">
								<textarea class="form-control" rows="3" id="create-describe"></textarea>
							</div>
						</div>
						
					</form>
					
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" id="saveCreateActivityBtn" class="btn btn-primary">保存</button>

				</div>
			</div>
		</div>
	</div>
	<!-- 删除的模态窗口 -->
	<div class="modal fade" id="exitModal" role="dialog">
		<div class="modal-dialog" role="document" style="width: 30%;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title">删除</h4>
				</div>
				<div class="modal-body">
					<p>您确定要删除吗？</p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" data-dismiss="modal" id="del">确定</button>
				</div>
			</div>
		</div>
	</div>

	<!-- 修改市场活动的模态窗口 -->
	<div class="modal fade" id="editActivityModal" role="dialog">
		<div class="modal-dialog" role="document" style="width: 85%;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title" id="myModalLabel2">修改市场活动</h4>
					<span id="sp1"></span>
				</div>
				<div class="modal-body">
				
					<form class="form-horizontal" role="form">
						<input type="hidden" id="edit-id">
						<div class="form-group">
							<label for="edit-marketActivityOwner" class="col-sm-2 control-label">所有者<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control"  id="edit-marketActivityOwner">
									<c:forEach items="${applicationScope.userList}" var="user">
										<option value="${user.name}">
												${user.name}
										</option>
									</c:forEach>
								</select>
							</div>
                            <label for="edit-marketActivityName" class="col-sm-2 control-label">名称<span style="font-size: 15px; color: red;">*</span></label>
                            <div class="col-sm-10" style="width: 300px;">
                                <input type="text" class="form-control" id="edit-marketActivityName" value="">
                            </div>
						</div>

						<div class="form-group">
							<label for="edit-startTime" class="col-sm-2 control-label">开始日期</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="date" class="form-control" id="edit-startTime" value="">
							</div>
							<label for="edit-endTime" class="col-sm-2 control-label">结束日期</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="date" class="form-control" id="edit-endTime" value="">
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-cost" class="col-sm-2 control-label">成本</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-cost" value="">
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-describe" class="col-sm-2 control-label">描述</label>
							<div class="col-sm-10" style="width: 81%;">
								<textarea class="form-control" rows="3" id="edit-describe"></textarea>
							</div>
						</div>
						
					</form>
					
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" id="update">修改</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 导入市场活动的模态窗口 -->
    <div class="modal fade" id="importActivityModal" role="dialog">
        <div class="modal-dialog" role="document" style="width: 85%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">导入市场活动</h4>
                </div>
                <div class="modal-body" style="height: 350px;">
                    <div style="position: relative;top: 20px; left: 50px;">
                        请选择要上传的文件：<small style="color: gray;">[仅支持.xls]</small>
                    </div>
                    <div style="position: relative;top: 40px; left: 50px;">
                        <input type="file" id="activityFile">
                    </div>
                    <div style="position: relative; width: 400px; height: 320px; left: 45% ; top: -40px;" >
                        <h3>重要提示</h3>
                        <ul>
                            <li>操作仅针对Excel，仅支持后缀名为XLS的文件。</li>
                            <li>给定文件的第一行将视为字段名。</li>
                            <li>请确认您的文件大小不超过5MB。</li>
                            <li>日期值以文本形式保存，必须符合yyyy-MM-dd格式。</li>
                            <li>日期时间以文本形式保存，必须符合yyyy-MM-dd HH:mm:ss的格式。</li>
                            <li>默认情况下，字符编码是UTF-8 (统一码)，请确保您导入的文件使用的是正确的字符编码方式。</li>
                            <li>建议您在导入真实数据之前用测试文件测试文件导入功能。</li>
                        </ul>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button id="importActivityBtn" type="button" class="btn btn-primary">导入</button>
                </div>
            </div>
        </div>
    </div>
	
	
	<div>
		<div style="position: relative; left: 10px; top: -10px;">
			<div class="page-header">
				<h3>市场活动列表</h3>
			</div>
		</div>
	</div>
	<div style="position: relative; top: -20px; left: 0px; width: 100%; height: 100%;">
		<div style="width: 100%; position: absolute;top: 5px; left: 10px;">
		
			<div class="btn-toolbar" role="toolbar" style="height: 80px;">
				<form class="form-inline" role="form" style="position: relative;top: 8%; left: 5px;">
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">名称</div>
				      <input class="form-control" id="name" type="text">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">所有者</div>
				      <input class="form-control" id="owner" type="text">
				    </div>
				  </div>
				  <button type="button" id="query" class="btn btn-default">查询</button>
				  
				</form>
			</div>
			<div class="btn-toolbar" role="toolbar" style="background-color: #F7F7F7; height: 50px; position: relative;top: 5px;">
				<div class="btn-group" style="position: relative; top: 18%;">
				  <button type="button" class="btn btn-primary" data-toggle="modal" id="createActivityBtn" data-target="#createActivityModal"><span class="glyphicon glyphicon-plus"></span> 创建</button>
					<button type="button" class="btn btn-danger" data-toggle="modal" id="deleteIdALL" ><span class="glyphicon glyphicon-minus"></span> 批量删除</button>
				</div>
				<div class="btn-group" style="position: relative; top: 18%;">
                    <button id="importActivity" type="button" class="btn btn-default" data-toggle="modal" data-target="#importActivityModal" ><span class="glyphicon glyphicon-import"></span> 上传列表数据（导入）</button>
                    <button id="exportActivityAllBtn" type="button"  class="btn btn-default"><span class="glyphicon glyphicon-export"></span> 下载列表数据（批量导出）</button>
                    <button id="exportActivityXzBtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-export"></span> 下载列表数据（选择导出）</button>
                </div>
			</div>
			<div style="position: relative;top: 10px;">
				<table class="table table-hover">
					<thead>
						<tr style="color: #B3B3B3;">
							<td><input type="checkbox" id="chckAll"/></td>
							<td>名称</td>
                            <td>所有者</td>
							<td>开始日期</td>
							<td>结束日期</td>
							<td>操作</td>
						</tr>
					</thead>
					<tbody id="tBody">
						<c:forEach items="${pageInfo.list}" var="act">
							<tr class="active">
								<td style="width:50px;height: 50px"><input type="checkbox" value="${act.id}" id="actId"/></td>
								<td style="width: 120px;height: 50px"><a style="text-decoration: none; cursor: pointer;" onclick="toDetail(${act.id})">${act.name}</a></td>
								<td style="width: 120px;height: 50px">${act.owner}</td>
								<td style="width: 100px;height: 50px">${act.startDate}</td>
								<td style="width: 100px;height: 50px">${act.endDate}</td>
								<td style="width: 110px;height: 50px">
									<button type="button" class="btn btn-default" data-toggle="modal"  onclick="edits(${act.id})"><span class="glyphicon glyphicon-pencil"></span> 修改</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<button type="button" class="btn btn-danger" data-toggle="modal"  onclick="deletes(${act.id})"><span class="glyphicon glyphicon-minus"></span> 删除</button>
								</td>

							</tr>
						</c:forEach>

					</tbody>
				</table>
			</div>
			
			<div style="height: 50px; position: relative;top: 30px;">
				<div>
					<button type="button" class="btn btn-default" style="cursor: default;">共<b>${pageInfo.total}</b>条记录</button>
				</div>
				<div class="btn-group" style="position: relative;top: -34px; left: 110px;">
					<button type="button" class="btn btn-default" style="cursor: default;">显示</button>
					<div class="btn-group">
						<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
							5
							<span class="caret"></span>
						</button>
					</div>
					<button type="button" class="btn btn-default" style="cursor: default;">条/页</button>
				</div>
				<div style="position: relative;top: -88px; left: 285px;">
					<nav>
						<ul class="pagination">
							<li class=""><a href="${pageContext.request.contextPath}/workbench/findAll?page=1">首页</a></li>
							<c:if test="${pageInfo.hasPreviousPage}">
								<li class=""><a href="${pageContext.request.contextPath}/workbench/findAll?page=${pageInfo.pageNum-1}">上一页</a></li>
							</c:if>
							<c:forEach begin="1" end="${pageInfo.pages}" var="item">
								<c:if test="${pageInfo.pageNum==item}">
									<li>
										<a style="background-color: burlywood">${item}</a>
									</li>
								</c:if>
								<c:if test="${pageInfo.pageNum!=item}">
									<li>
										<a href="${pageContext.request.contextPath}/workbench/findAll?page=${item}">${item}</a>
									</li>
								</c:if>
							</c:forEach>
							<c:if test="${pageInfo.hasNextPage}">
								<li><a href="${pageContext.request.contextPath}/workbench/findAll?page=${pageInfo.pageNum+1}">下一页</a></li>
							</c:if>

							<li class=""><a href="${pageContext.request.contextPath}/workbench/findAll?page=${pageInfo.pages}">末页</a></li>
						</ul>
					</nav>
				</div>
			</div>
			
		</div>
		
	</div>
</body>
</html>